<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>Hello Spring Cloud Alibaba</h1>
<button onclick="doBuy()">Do Buy</button>
<span id="result"></span>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    //客户端调试程序的方式:(debugger,log,排除法)
    function doBuy(){
        let url="http://localhost:9000/nacos/provider/echo/ab";
        let spanObj=document.getElementById("result");
        axios.get(url)
             .then(function (responce){
                 console.log(responce);
                 spanObj.innerHTML=responce.data;
             })
             .catch(function (error){
                 console.log(error);
                 if(error.response.status==429){
                     spanObj.innerHTML="访问太频繁了";
                 }
             });
    }
</script>
</body>
</html>